<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("admin.ad.add")}</title>


<link href="${base}/resources/admin/css/amazeui.css" rel="stylesheet" type="text/css" />
<link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />

</head>
<body>
	<div class="path">
		<a href="${base}/asl-admin/common/index.htm">${message("admin.path.index")}</a> &raquo; ${message("admin.ad.add")}
	</div>
	<form id="inputForm" action="save.htm" method="post">
		<table class="input">
			<tr>
				<th>
					${message("Ad.adPosition")}:
				</th>
				<td>
					<select name="adPositionId">
						[#list adPositions as adPosition]
							<option value="${adPosition.id}">${adPosition.name} 【${adPosition.description}】</option>
						[/#list]
					</select>
				</td>
			</tr>
			<tr id="pathTr">
				<th>
					<span class="requiredField"></span>${message("Ad.path")}:
				</th>
				<td>
					<span class="fieldSet">
						<input type="text" id="path" name="path" class="text" maxlength="200" />
						<input type="button" id="browserButton" class="button" value="${message("admin.browser.select")}" />
					</span>
				</td>
			</tr>
			[#--<tr>--]
				[#--<th>--]
					[#--${message("Ad.beginDate")}:--]
				[#--</th>--]
				[#--<td>--]
					[#--<input type="text" id="beginDate" name="beginDate" class="text Wdate" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm:ss', maxDate: '#F{$dp.$D(\'endDate\')}'});" />--]
				[#--</td>--]
			[#--</tr>--]
			[#--<tr>--]
				[#--<th>--]
					[#--${message("Ad.endDate")}:--]
				[#--</th>--]
				[#--<td>--]
					[#--<input type="text" id="endDate" name="endDate" class="text Wdate" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm:ss', minDate: '#F{$dp.$D(\'beginDate\')}'});" />--]
				[#--</td>--]
			[#--</tr>--]
            <tr>
                <th>
                    老师:
                </th>
                <td>
                    <select name="teacherId" data-am-selected="{searchBox: 1}" >
					[#list teachers as teacher ]
						[#if teacher.type="teacher"]
						<option value="${teacher.id}" >${teacher.username}[#if teacher.name]（${teacher.name}）[/#if]</option>
						[/#if]
					[/#list]
                    </select>
                </td>
            </tr>
			[#--<tr>--]
				[#--<th>--]
					[#--${message("admin.common.order")}:--]
				[#--</th>--]
				[#--<td>--]
					[#--<input type="text" name="order" class="text" maxlength="9" />--]
				[#--</td>--]
			[#--</tr>--]
			<tr>
				<th>
					&nbsp;
				</th>
				<td>
					<input type="submit" class="button" value="${message("admin.common.submit")}" />
					<input type="button" class="button" value="${message("admin.common.back")}" onclick="location.href='list.htm'" />
				</td>
			</tr>
		</table>
	</form>
</body>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/amazeui.min.js"></script>
<script type="text/javascript" src="${base}/resources/admin/editor/kindeditor.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/input.js"></script>
<script type="text/javascript" src="${base}/resources/admin/datePicker/WdatePicker.js"></script>
<script type="text/javascript">
    $().ready(function() {

        var $inputForm = $("#inputForm");
        var $browserButton = $("#browserButton");

        $browserButton.browser();

	[@flash_message /]
        // 表单验证
        $inputForm.validate({
            rules: {
                adPositionId: "required",
                type: "required",
                order: "digits"
            }
        });

    });
</script>
</html>